//===============================================================================
// Microsoft patterns & practices
// Guidance Explorer Offline Client
//===============================================================================
// Copyright  Microsoft Corporation.  All rights reserved.
// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY
// OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT
// LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
// FITNESS FOR A PARTICULAR PURPOSE.
//===============================================================================



using System.Xml;

namespace GuidanceExplorer.Schemas
{
    static class SchemaHelper
    {
        public const string GuidanceItemNamespace = "urn:microsoft:guidanceexplorer:guidanceItem";
        public const string GuidanceTypeNamespace = "urn:microsoft:guidanceexplorer:guidanceType";
        public const string Namespace = "urn:microsoft:guidanceexplorer";

        public static class GuidanceExplorer
        {
            public const string Element = "guidanceExplorer";
        }

        public static class Library
        {
            public const string Element = "library";
            public const string Name = "name";
            public const string Caption = "caption";
            public const string ReadProtection = "readProtection";
            public const string FileSubscribed = "suscribed";
            public const string WebSubscribed = "webSuscribed";
            public const string URL = "url";
            public const string OriginalSource = "originalSource";
        }

        public static class UserViews
        {
            public const string Element = "userViews";
            public const string Structure = "structure";
        }

        public static class GlobalViews
        {
            public const string Element = "globalViews";
            public const string Structure = "structure";
        }

        public static class Solution
        {
            public const string Element = "solution";
            public const string Name = "name";
        }
        
        public static class LibraryStructure
        {
            public const string Element = "libraryStructure";
        }

        public static class Items
        {
            public const string Element = "items";
        }

        public static class Item
        {
            public const string Element = "item";
        }

        public static class Folder
        {
            public const string Element = "folder";
            public const string Caption = "caption";
        }

        public static class Columns
        {
            public const string Element = "columns";
        }

        public static class Column
        {
            public const string Element = "column";
            public const string Source = "source";
            public const string Caption = "caption";
            public const string Sort = "sort";
            public const string Visible = "visible";
            public const string Width = "width";
            public const string Position = "position";
            public const string Filter = "filter";
        }

        public static class FieldSearchCriteria
        {
            public const string SearchTerm = "searchTerm";
            public const string Value = "value";
            public const string Field = "field";
        }

        public static class View
        {
            public const string Element = "view";
            public const string Id = "id";
            public const string Caption = "caption";
            public const string Author = "author";
            public const string Description = "description";
            public const string CreationDate = "creationDate";
            public const string RootView = "rootView";
            public const string Items = "items";
        }

        public static class SearchView
        {
            public const string Element = "searchView";
            public const string Id = "id";
            public const string Caption = "caption";
            public const string Author = "author";
            public const string Description = "description";
            public const string CreationDate = "creationDate";
            public const string ContainerScopeType = "containerScopeType";
            public const string ContainerScope = "containerScope";
            public const string RootView = "rootView";
        }
        public static class Checklist
        {
            public const string Element = "checklist";
            public const string Id = "id";
            public const string Caption = "caption";
            public const string Author = "author";
            public const string Description = "description";
            public const string CreationDate = "creationDate";
            public const string RootView = "rootView";
            public const string Items = "items";
        }
        public static class ChecklistItem
        {
            public const string IsChecked = "checked";
            public const string Notes = "notes";
            public const string Element = "checklistItem";
            public const string Id = "id";
            public const string Checked = "checked";
            public const string Title = "title";
            public const string Type = "type";
            public const string CSSFile = "cssFile";
            public const string Date = "Date";
            public const string Source = "Source";
        }
        public static class Criteria
        {
            public const string Element = "criteria";
        }
        public static class GuidanceItem
        {
            public const string Element = "guidanceItem";
            public const string Title = "title";
            public const string Type = "type";
            public const string Id = "id";
            public const string CSSFile = "cssFile";
            public const string Date = "Date";
            public const string FilePath = "filePath";
            public const string Images = "Images";
            public const string Content = "content";
            public const string Source = "Source";
        }

        public static class Images
        {
            public const string Element = "Image";
            public const string name = "name";
        }

        public static class GuidanceTypes
        {
            public const string Element = "guidanceTypes";
        }

        public static class GuidanceType
        {
            public const string Element = "guidanceType";
            public const string Id = "id";
            public const string SchemaId = "schemaid";
            public const string Name = "name";
            public const string DisplayName = "displayName";
            public const string ListDisplayName = "listDisplayName";
            public const string NewGuidanceItemDisplayName = "newItemDisplayName";
            public const string TemplateFileName = "templateFileName";
            public const string ExampleFileName = "exampleFileName";
            public const string ImageFileName = "imageFileName";
            public const string IsDeleted = "isDeleted";
            public const string NodeDisplayName = "nodeDisplayName";
            public const string CreationDate = "creationDate";
        }

        public static class Fields
        {
            public const string Element = "fields";
        }

        public static class Field
        {
            public const string Element = "field";
            public const string Name = "name";
            public const string Caption = "caption";
            public const string DefaultSort = "sort";
            public const string Type = "type";
            public const string Distinct = "distinct";
            public const string Values = "values";
            public const string Editable = "editable";
            public const string Width = "width";
            public const string Position = "position";
            public const string Visible = "visible";
            public const string ShowInGuidanceTypeNode = "showInGuidanceTypeNode";
        }

        public static class Html
        {
            public const string Header = "<html>\n<head><style type=\"text/css\">\n{0}\n</style></head>";
            public const string Footer = "</html>";
        }

        public static bool IsGuidanceExplorerNode(XmlReader reader, string nodeName)
        {
            return (reader.Name == nodeName && reader.NodeType == XmlNodeType.Element && reader.NamespaceURI == SchemaHelper.Namespace);
        }

        public static bool IsGuidanceItemNode(XmlReader reader, string nodeName)
        {
            return (reader.Name == nodeName && reader.NodeType == XmlNodeType.Element && reader.NamespaceURI == SchemaHelper.GuidanceItemNamespace);
        }

        public static bool IsGuidanceTypesNode(XmlReader reader, string nodeName)
        {
            return (reader.Name == nodeName && reader.NodeType == XmlNodeType.Element && reader.NamespaceURI == SchemaHelper.GuidanceTypeNamespace);
        }
    }
}

